home *** CD-ROM | disk | FTP | other *** search
/ LAUNCH 17 / LAUNCH.BIN / mac / Install These / DrawSprocket 1.1.2 GM / DrawSprocket / DSp Debugging Tips < prev   
Text File  |  1997-09-18  |  3KB  |  71 lines

  1. ********************************************************************************
  2.  
  3.                    Debugging Tips for DrawSprocket Developers
  4.                   
  5.                         Last Updated: November 25, 1996
  6.  
  7. ********************************************************************************
  8.  
  9. This file contains some useful tips for debugging your games that are using
  10. DrawSprocket.  It is compiled from questions and issues that are brought to our
  11. attention regularly, so please read and use this information before reporting
  12. problems to Apple.
  13.  
  14. If you find that none of the suggestions here address the problem, send a bug
  15. report to sprockets@adr.apple.com.
  16.  
  17. -    Use the DrawSprocketDebugLib for all your development.  It will flag
  18.     problems by dropping you into MacsBug with warning messages that describe
  19.     what you did wrong.
  20.  
  21. -    Make sure you have the latest DrawSprocket.  Verify this by going to
  22.     <http://devworld.apple.com/dev/games> and comparing the version of what
  23.     you have against what is available.
  24.  
  25. -    Check for multiple copies of DrawSprocket on your machine.  You may be
  26.     running against one you aren't expecting, and it may be older.
  27.     
  28. -    Use debug mode to stop DSp from gamma fading and showing the blanking
  29.     window.  This can be done programmatically with the DSpSetDebugMode() call,
  30.     or by creating a folder in the same directory as your game called
  31.     "DSpSetDebugMode".    Debug mode only works with the debug build of DSp, and
  32.     comes in *very* useful when you drop into the debugger when the screen is
  33.     faded out.
  34.  
  35. -    Check the return codes from all DrawSprocket calls.  DSp returns valuable
  36.     information in the return codes, and your game really shouldn't ignore
  37.     them.  If you ignore them and something bad happens, you're probably going
  38.     to crash.
  39.     
  40. -    Compare how you are doing things with how the available sample source
  41.     code does things.  You might spot a subtlety that you missed before.
  42.     
  43. -    Make sure your application has a large enough heap to run AND allocate
  44.     your graphics pages.  To roughly calculate the amount of memory used by DSp
  45.     (on your behalf), figure:
  46.     
  47.         page_size = width * height * pixel_byte_size
  48.         allocated memory = ( page_count - 1 ) * page_size
  49.         
  50.     This is a generalization, but should handle the worst case scenario.  If
  51.     you are allocating a 640x480 8 bit context with a page count, you would get:
  52.     
  53.         page_size = 640 * 480 * 1 = 300k
  54.         allocated memory = ( 2 - 1 ) * 300k, or 300k.
  55.         
  56.     Additional memory is required for AltBuffers, etc.
  57.     
  58. -    Try eliminating sections of code until you can track down a statement that
  59.     causes the bad behavior to manifest.  For example, if you find that you are
  60.     getting an address exception at a given point in your program, try
  61.     eliminating code sections from the execution path until the address
  62.     exception doesn't occur.  This will often lead you directly to a memory
  63.     trashing bug.
  64.     
  65. -    If you have installed the Display Manger manually (pre 7.5.3 systems), make
  66.     sure you are using the "Display Library" shared library, and not the
  67.     "DisplayLib" shared library.  "DisplayLib", while having the same file name
  68.     as the desired code fragment, is actually a linker stub library.  It is
  69.     supposed to have a file type of 'stub', but it doesn't, and that's wrong,
  70.     and CFM will try to link your program to it.
  71.